# -*- coding: UTF-8 -*-
import pprint
from tools.Request_General import BaseAPI



class DeepModel(BaseAPI):
    """
    业务模型视图3.0
    """

    def create_object(self, payload):
        """
        对象创建
        """
        r = self.request_send(json=payload)
        return r

    def edit_object(self, payload):
        """
        对象修改
        """
        r = self.request_send(json=payload)
        return r

    def data_edit(self, payload):
        """
        数据管理 - 数据编辑
        """
        r = self.request_send(json=payload)
        return r

    def create_link(self, payload):
        """
        链接新建
        """
        r = self.request_send(json=payload)
        return r

    def create_property(self, payload):
        """
        新建属性
        """
        r = self.request_send(json=payload)
        return r

    def edit_link(self,payload):
        """
        链接修改
        """
        r = self.request_send(json=payload)
        return r

    def delete_object(self, payload):
        """
        对象删除
        """
        r = self.request_send(json=payload)
        return r


    def delete_link(self, payload):
        """
        链接删除
        """
        r = self.request_send(json=payload)
        return r

    def mainview_get(self, par):
        """
        主视图查询
        """
        r = self.request_send(params=par)
        return r

    def data_sheet_query(self, payload):
        """
        数据管理查询
        """
        r = self.request_send(json=payload)
        return r

    def access_rule_preview(self, payload):
        """
        访问规则 - 预览
        """
        r = self.request_send(json=payload)
        return r

    def access_rule_instance(self, payload):
        """
        访问规则 - 新建
        """
        r = self.request_send(json=payload)
        return r

    def access_rule_evaluate(self, payload):
        """
        访问规则 - 测试
        """
        r = self.request_send(json=payload)
        return r

    def access_rule_check(self, par):
        """
        访问规则 - 校验
        """
        r = self.request_send(params=par)
        return r

if __name__ == '__main__':
    # 获取headers
    headers = {
        "cookie":"cloud_deepfos_users=%7B%22color%22%3A%226%22%2C%22email%22%3A%22wanyu.jiang%40proinnova.com.cn%22%2C%22invitationActivation%22%3Atrue%2C%22nickName%22%3A%22%E5%A7%9C%E6%99%9A%E7%8E%89%22%2C%22nickname%22%3A%22%E5%A7%9C%E6%99%9A%E7%8E%89%22%2C%22token%22%3A%22E882DC293AD73C048E956F0F8A32B5E1F4DE9EA4EFBC51ADF515061F78FBFD46%22%2C%22tokenKey%22%3A%22cloud_deepfos_token%22%2C%22type%22%3A1%2C%22userId%22%3A%228e3ce009-d6ee-4fe4-9759-1fcc5146fbbe%22%2C%22username%22%3A%22jiangwanyu%22%7D; cloud_deepfos_token=E882DC293AD73C048E956F0F8A32B5E1F4DE9EA4EFBC51ADF515061F78FBFD46; hotfix_deepfos_users=%7B%22color%22%3A%224%22%2C%22email%22%3A%22wanyu.jiang%40deepfinance.com%22%2C%22invitationActivation%22%3Atrue%2C%22nickName%22%3A%22%E5%A7%9C%E6%99%9A%E7%8E%89%22%2C%22nickname%22%3A%22%E5%A7%9C%E6%99%9A%E7%8E%89%22%2C%22token%22%3A%2276BA57015C2CAC3FB2AD36A78C4338B1F59FF7F85870E6110C0CE8E6BE0C0FBF%22%2C%22tokenKey%22%3A%22hotfix_deepfos_token%22%2C%22type%22%3A1%2C%22userId%22%3A%2257ad4e48-9e06-4f77-900b-2c70dfee4d7a%22%2C%22username%22%3A%22Willy%22%7D; hotfix_deepfos_token=76BA57015C2CAC3FB2AD36A78C4338B1F59FF7F85870E6110C0CE8E6BE0C0FBF; alpha_deepfos_users=%7B%22color%22%3A%226%22%2C%22email%22%3A%22wanyu.jiang%40proinnova.com.cn%22%2C%22invitationActivation%22%3Atrue%2C%22nickName%22%3A%22%E5%A7%9C%E6%99%9A%E7%8E%89%22%2C%22nickname%22%3A%22%E5%A7%9C%E6%99%9A%E7%8E%89%22%2C%22token%22%3A%22E882DC293AD73C048E956F0F8A32B5E128F772D4CC4B2646217F73242933ECAA%22%2C%22tokenKey%22%3A%22alpha_deepfos_token%22%2C%22type%22%3A1%2C%22userId%22%3A%228e3ce009-d6ee-4fe4-9759-1fcc5146fbbe%22%2C%22username%22%3A%22jiangwanyu%22%7D; alpha_deepfos_token=E882DC293AD73C048E956F0F8A32B5E128F772D4CC4B2646217F73242933ECAA; shtest_deepfos_users=%7B%22color%22%3A%227%22%2C%22email%22%3A%22wanyu.jiang%40proinnova.com.cn%22%2C%22invitationActivation%22%3Atrue%2C%22mobilePhone%22%3A%22%22%2C%22nickName%22%3A%22%22%2C%22nickname%22%3A%22%22%2C%22token%22%3A%226B05DE3CC456E3DDB9D535EEC3D6727CA09F46E1275C3A8A6EB8DEFD14194832%22%2C%22tokenKey%22%3A%22shtest_deepfos_token%22%2C%22type%22%3A1%2C%22userId%22%3A%22cac018a5-3a06-4588-ace2-51ea151e1c7b%22%2C%22username%22%3A%2221R9qTvtnw%22%7D; shtest_deepfos_token=6B05DE3CC456E3DDB9D535EEC3D6727CA09F46E1275C3A8A6EB8DEFD14194832; v3-dev_deepfos_users=%7B%22color%22%3A%226%22%2C%22email%22%3A%22siqi.qiu%40deepfinance.com%22%2C%22invitationActivation%22%3Atrue%2C%22nickName%22%3A%22qiuqiuqiu123456789%22%2C%22nickname%22%3A%22qiuqiuqiu123456789%22%2C%22token%22%3A%22151CEC2A96362525451BBED74926B627C5559DF488DBDC0A9299D9A483D55AAF%22%2C%22tokenKey%22%3A%22v3-dev_deepfos_token%22%2C%22type%22%3A1%2C%22userId%22%3A%2283bc7bee-3382-4f19-8883-5a6bf60f5dab%22%2C%22username%22%3A%22qiuqiuqiu2%22%7D; v3-dev_deepfos_token=151CEC2A96362525451BBED74926B627C5559DF488DBDC0A9299D9A483D55AAF; v3test_deepfos_users=%7B%22color%22%3A%222%22%2C%22email%22%3A%22wanyu.jiang%40deepfinance.com%22%2C%22invitationActivation%22%3Atrue%2C%22mobilePhone%22%3A%2217602189130%22%2C%22nickName%22%3A%22%E7%85%8E%E4%B8%80%E7%A2%97%E9%B1%BCqqqqqqqq111111111%22%2C%22nickname%22%3A%22%E7%85%8E%E4%B8%80%E7%A2%97%E9%B1%BCqqqqqqqq111111111%22%2C%22token%22%3A%22E882DC293AD73C048E956F0F8A32B5E1596D311512E0737F5A101F26C997645C%22%2C%22tokenKey%22%3A%22v3test_deepfos_token%22%2C%22type%22%3A1%2C%22userId%22%3A%22f0c3e4eb-fc12-4aad-a398-868f0ee4cd70%22%2C%22username%22%3A%22jiangwanyu%22%7D; v3test_deepfos_token=E882DC293AD73C048E956F0F8A32B5E1596D311512E0737F5A101F26C997645C",
        "language": "zh-cn","app": "chhwqs058","space": "chhwqs"}
    dp = DeepModel(headers)
    r= dp.access_rule_evaluate({})

    print(r.text)
    pass

